package com.baidu.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author ShiLei
 * @version v1.0
 * @date 2020-03-24 17:33
 */
@Configuration
public class ApplicationConfig {


    @Bean
    @LoadBalanced //使用RestTemplate 时如果有多个微服务 需要添加该注解使其达到负载均衡
    public RestTemplate get() {
        return new RestTemplate();
    }
}
